//
//  SRSpeakingDatabaseManager


#import <Foundation/Foundation.h>

#import "SRSpeakingTestModel.h"
#import "SRBookPageTrackItemModel.h"
#import "FZHomeCourseModel.h"
#import "SRHomeworkPictureModel.h"

@interface SRSpeakingDatabaseManager : NSObject

+ (BOOL)saveMyUnpublishedSpeakingModel:(SRSpeakingTestModel *)model;
+ (BOOL)removeMyDraftSpeakingModelWithDataID:(NSString *)dataID;
+ (BOOL)removeMyUnpublishedSpeakingModel:(SRSpeakingTestModel *)model;
+ (BOOL)removeMyUnpublishedSpeakingModelWithDataID:(NSString *)identifier;

+ (BOOL)removeMyUnpublishedSpeakingModels:(NSArray *)models;

+ (NSArray *)searchMyUnpublishedSpeakingModel:(NSString *)userId finished:(BOOL)finished;
+ (NSArray *)searchMyDraftModelWithDataID:(NSString *)dataID;


#pragma mark - Sentence Upload record

+ (BOOL)saveSpeakingTrackModel:(SRBookPageTrackItemModel *)model fileName:(NSString *)mp3Name shareUrl:(NSString *)shareURl;
+ (BOOL)removeSpeakingTrackModelWithDataID:(NSString *)dataID;
+ (NSArray *)searchSpeakingTrackModelWithDataID:(NSString *)dataID;

#pragma mark - Book Info 

+ (BOOL)saveBookModel:(FZHomeCourseModel *)model;
+ (BOOL)updateBookModel:(NSString *)bookID pageIndex:(NSInteger )pageIndex pageID:(NSString *)pageID;
+ (BOOL)removeBookModelWithBookID:(NSString *)book_id;
+ (NSArray *)searchBookModelWithBookID:(NSString *)dataID;

#pragma mark - Audio

+ (BOOL)saveAudioModel:(SRHomeworkPictureModel *)model;
    //主要更新localPath , downloadProgress, downloadState
    //+ (BOOL)updateAudioModel:(SRHomeworkPictureModel *)model;
+ (BOOL)updateAudioWithID:(NSString *)audioID playProgress:(CGFloat)playProgress;
+ (BOOL)updateAudioWithID:(NSString *)audioID playFinish:(BOOL)playFinished;
+ (BOOL)updateAudioWithID:(NSString *)audioID learnTime:(CGFloat)learnTime;

+ (BOOL)removeAudioModelWithDataID:(NSString *)dataID;
+ (NSArray *)searchAudioModelWithDataID:(NSString *)dataID;
+ (NSArray *)searchAudioModels;
+ (NSArray *)searchAudioModelsWithTaskID:(NSString *)taskID;

@end
